﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace SheepCultivation.Common.Migrations
{
    /// <inheritdoc />
    public partial class db1127 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "DeathManagement",
                columns: table => new
                {
                    DeathManagementId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BreedingSheepArchiveId = table.Column<int>(type: "int", nullable: false),
                    DeathType = table.Column<int>(type: "int", nullable: false),
                    SheepvarietyId = table.Column<int>(type: "int", nullable: false),
                    Sexs = table.Column<int>(type: "int", nullable: false),
                    BuildingId = table.Column<int>(type: "int", nullable: false),
                    ColumnsId = table.Column<int>(type: "int", nullable: false),
                    DeathTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SheepTypesId = table.Column<int>(type: "int", nullable: false),
                    Numberes = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeathManagementRemark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepHybridizationId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DeathManagement", x => x.DeathManagementId);
                });

            migrationBuilder.CreateTable(
                name: "Eliminates",
                columns: table => new
                {
                    EliminatesId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BreedingSheepArchiveId = table.Column<int>(type: "int", nullable: false),
                    SheepvarietyId = table.Column<int>(type: "int", nullable: false),
                    BuildingId = table.Column<int>(type: "int", nullable: false),
                    ColumnsId = table.Column<int>(type: "int", nullable: false),
                    EliminateState = table.Column<int>(type: "int", nullable: false),
                    EliminatesRenamk = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    EliminateMeasure = table.Column<int>(type: "int", nullable: false),
                    EliminatesTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SheepTypesId = table.Column<int>(type: "int", nullable: false),
                    Numberes = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SerialNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    EliminatesRemark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepHybridizationId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Eliminates", x => x.EliminatesId);
                });

            migrationBuilder.CreateTable(
                name: "SheepTypes",
                columns: table => new
                {
                    SheepTypesId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SheepTypesName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SheepTypes", x => x.SheepTypesId);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "DeathManagement");

            migrationBuilder.DropTable(
                name: "Eliminates");

            migrationBuilder.DropTable(
                name: "SheepTypes");
        }
    }
}
